// FFA tag detection by regex
var rgxFfaUrl = /"http.+adsfac.eu/;
var rgxFfaImgTag = /<img.+src="http.+adsfac\.eu.+>/;
var rgxFfaJsTag = /<script.+src="http.+adsfac\.eu.+>/;

// DFA tag detection by regex
// TODO: other ad servers

var responseString = "";

if (rgxFfaUrl.test(document.body.innerHTML)) {
	
	responseString = "Dies ist ein Test.";
	chrome.extension.sendRequest({"response": responseString}, function(response) {});
	
} else if(rgxFfaImgTag.test(document.body.innerHTML)){
	
	chrome.extension.sendRequest({}, function(response) {});
	
} else if(rgxFfaJsTag.test(document.body.innerHTML)){
	
	chrome.extension.sendRequest({}, function(response) {});
	
} else {
	console.log("No ad tag was found!");
}